package com.miyake.dsp.osa.lab.wrapper;

import com.miyake.dsp.common.CommonTool;
import com.miyake.dsp.osa.lab.Calculator;
import com.miyake.dsp.osa.lab.LabUiAnnotation;
import com.miyake.dsp.osa.lab.ZoneAverageSetting;
@LabUiAnnotation(caption="Zone Average")
public class ZoneAverageWrapper extends Calculator {
	public static final String INPUT = "Input";
	public static final String OUTPUT = "Output";
	
	private ZoneAverageSetting setting;

	public ZoneAverageWrapper(ZoneAverageSetting setting) {
		this.setting = setting;
		initInput(INPUT);
		initOutput(OUTPUT);
	}
	
	@Override
	public synchronized void process() {
		setOutput(OUTPUT, CommonTool.getZoneAverage(getInput(INPUT).getRealPart(), setting.getDivisions()));
	}

	@Override
	public Object getSetting() {
		return this.setting;
	}

}
